<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>移动端模块-轮播图</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="${s.base}/js/layui/css/layui.css" media="all" />
    <link rel="stylesheet" href="${s.base}/css/base/base.css" media="all" /></head>

<body class="childrenBody">
<form class="layui-form">
    <input type="hidden" id="id" name="id" value="${mobBanner.id}" />
    <div class="layui-form-item layui-row layui-col-xs12">
        <label class="layui-form-label">
            <span class="red">*</span>&nbsp;&nbsp;所属分类</label>
        <div class="layui-input-block">
            <select class="form-control" name="mobBannerCode" lay-verify="required" id="mobBannerCode"></select>
        </div>
    </div>
    <div class="layui-form-item layui-row layui-col-xs12">
        <label class="layui-form-label">
            <span class="red">*</span>&nbsp;&nbsp;图片</label>&nbsp;&nbsp;<span style="color: red;">图片宽为750px,高为320px。<a target="_blank" href="https://tinypng.com/">立即压缩</a> </span>
        <!--单图片开始-->
        <div class="layui-input-block cy-uploadpic-ctn" id="image"  style=" float:left;margin:10px 0!important;position:relative; width: 90px; height: 90px;">
        </div>
        <!--单图片结束-->
    </div>
    <div class="layui-form-item layui-row layui-col-xs12">
        <label class="layui-form-label">
            <span class="red"></span>&nbsp;&nbsp;跳转地址</label>
        <div class="layui-input-block">
            <input type="text" class="layui-input" name="url" value="${mobBanner.url}" placeholder="请输入跳转地址"  autocomplete="off" /></div>
    </div>
    <div class="layui-form-item layui-row layui-col-xs12">
        <label class="layui-form-label">
            <span class="red"></span>&nbsp;&nbsp;描述</label>
        <div class="layui-input-block">
            <textarea class="layui-textarea" name="description" lay-verify="content" placeholder="请输入描述">${mobBanner.description}</textarea></div>
    </div>
    <div class="layui-form-item layui-row layui-col-xs12">
        <label class="layui-form-label">
            <span class="red">*</span>&nbsp;&nbsp;排序号</label>
        <div class="layui-input-block">
            <input type="text" class="layui-input" name="sort" value="${mobBanner.sort!'0'}" placeholder="请输入排序号" lay-verify="required" autocomplete="off" /></div>
    </div>
    <div class="layui-form-item layui-row layui-col-xs12">
        <label class="layui-form-label">
            <span class="red">*</span>&nbsp;&nbsp;是否展示</label>
        <div class="layui-input-block">
            <select class="form-control" name="showType" lay-verify="required" id="showType"></select>
        </div>
    </div>
    <div class="layui-form-item layui-row layui-col-xs12">
        <div class="layui-input-block">
            <button class="layui-btn layui-btn-sm" lay-submit="" lay-filter="submitBtn">确定</button>
            <button type="reset" class="layui-btn layui-btn-sm layui-btn-primary cancel">取消</button></div>
    </div>
</form>
<script type="text/javascript" src="${s.base}/js/layui/layui.js"></script>
<script type="text/javascript" src="${s.base}/js/base/base.js"></script>
<script type="text/javascript">layui.use(['form', 'jquery', 'baseUtil', 'pageUtil', 'fileUtil'],
    function() {
        var form = layui.form,
            $ = layui.jquery,
            baseUtil = layui.baseUtil,
            fileUtil = layui.fileUtil,
            pageUtil = layui.pageUtil;
        //单图片上传
        fileUtil.uploadImageNoSave('image',"mob/mobBanner","${mobBanner.image}");
        pageUtil.initDict("mob_banner_code,base_show_type",
            function(dictData) {
                pageUtil.showDict($("#mobBannerCode"), pageUtil.aceeptDictContentList(dictData, "mob_banner_code"), "", '${mobBanner.mobBannerCode}');
                pageUtil.showDict($("#showType"), pageUtil.aceeptDictContentList(dictData, "base_show_type"), "", '${mobBanner.showType}');
            });
        form.on('submit(submitBtn)',
            function(data) {
                baseUtil.postMethodResult("/mobBanner/addOrUpdate", data.field,
                    function(result) {
                        parent.location.reload();
                    });
                return false;
            });
    });</script>
</body>

</html>